using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VMSEINK
    {
        public DataRow Convert2MSEINK(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryMSEINK(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["MEMANDANT"] = " ".PadRight(2 ); 
         dwReturn["MEMAT"] = " ".PadRight(14 ); 
         dwReturn["MEVAR"] = " ".PadRight(3 ); 
         dwReturn["MELIEFNR"] = " ".PadRight(8 ); 
         dwReturn["MEADRSL"] = " ".PadRight(8 ); 
         dwReturn["MEHANBEZ"] = " ".PadRight(50 ); 
         dwReturn["MEEANL"] = " ".PadRight(0 ); 
         dwReturn["MEEANF"] = " ".PadRight(0 ); 
         dwReturn["MEEANA"] = " ".PadRight(0 ); 
         dwReturn["MEEANP"] = " ".PadRight(0 ); 
         dwReturn["MEZOLLTW1"] = " ".PadRight(0 ); 
         dwReturn["MEZOLLTW2"] = " ".PadRight(0 ); 
         dwReturn["MEZOLLTFR"] = " ".PadRight(0 ); 
         dwReturn["MEZEICHNR"] = " ".PadRight(14 ); 
         dwReturn["MEMWST"] = " ".PadRight(3 ); 
         dwReturn["MEUEBERL"] = " ".PadRight(0 ); 
         dwReturn["MEUNTERL"] = " ".PadRight(0 ); 
         dwReturn["MEMINBSLM"] = " ".PadRight(0 ); 
         dwReturn["MELIEFZT"] = " ".PadRight(0 ); 
         dwReturn["MEVPEINH1"] = " ".PadRight(4 ); 
         dwReturn["MELOSGR1"] = " ".PadRight(0 ); 
         dwReturn["MEPREIS1"] = " ".PadRight(0 ); 
         dwReturn["MEPRDAT1"] = " ".PadRight(0 ); 
         dwReturn["MEPREISAKT1"] = " ".PadRight(0 ); 
         dwReturn["MEDATVON1"] = " ".PadRight(0 ); 
         dwReturn["MEZUART1"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHL1"] = " ".PadRight(0 ); 
         dwReturn["MEMEEH1"] = " ".PadRight(3 ); 
         dwReturn["MEVPEINH2"] = " ".PadRight(4 ); 
         dwReturn["MELOSGR2"] = " ".PadRight(0 ); 
         dwReturn["MEPREIS2"] = " ".PadRight(0 ); 
         dwReturn["MEPRDAT2"] = " ".PadRight(0 ); 
         dwReturn["MEPREISAKT2"] = " ".PadRight(0 ); 
         dwReturn["MEDATVON2"] = " ".PadRight(0 ); 
         dwReturn["MEZUART2"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHL2"] = " ".PadRight(0 ); 
         dwReturn["MEMEEH2"] = " ".PadRight(3 ); 
         dwReturn["MEVPEINH3"] = " ".PadRight(4 ); 
         dwReturn["MELOSGR3"] = " ".PadRight(0 ); 
         dwReturn["MEPREIS3"] = " ".PadRight(0 ); 
         dwReturn["MEPRDAT3"] = " ".PadRight(0 ); 
         dwReturn["MEPREISAKT3"] = " ".PadRight(0 ); 
         dwReturn["MEDATVON3"] = " ".PadRight(0 ); 
         dwReturn["MEZUART3"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHL3"] = " ".PadRight(0 ); 
         dwReturn["MEMEEH3"] = " ".PadRight(3 ); 
         dwReturn["MEVPEINH4"] = " ".PadRight(4 ); 
         dwReturn["MELOSGR4"] = " ".PadRight(0 ); 
         dwReturn["MEPREIS4"] = " ".PadRight(0 ); 
         dwReturn["MEPRDAT4"] = " ".PadRight(0 ); 
         dwReturn["MEPREISAKT4"] = " ".PadRight(0 ); 
         dwReturn["MEDATVON4"] = " ".PadRight(0 ); 
         dwReturn["MEZUART4"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHL4"] = " ".PadRight(0 ); 
         dwReturn["MEMEEH4"] = " ".PadRight(3 ); 
         dwReturn["MEVPEINH5"] = " ".PadRight(4 ); 
         dwReturn["MELOSGR5"] = " ".PadRight(0 ); 
         dwReturn["MEPREIS5"] = " ".PadRight(0 ); 
         dwReturn["MEPRDAT5"] = " ".PadRight(0 ); 
         dwReturn["MEPREISAKT5"] = " ".PadRight(0 ); 
         dwReturn["MEDATVON5"] = " ".PadRight(0 ); 
         dwReturn["MEZUART5"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHL5"] = " ".PadRight(0 ); 
         dwReturn["MEMEEH5"] = " ".PadRight(3 ); 
         dwReturn["MEKONSI"] = " ".PadRight(1 ); 
         dwReturn["MEBONUS"] = " ".PadRight(1 ); 
         dwReturn["MEZUARTA"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHLA"] = " ".PadRight(0 ); 
         dwReturn["MEMEEHA"] = " ".PadRight(3 ); 
         dwReturn["MEZUARTB"] = " ".PadRight(3 ); 
         dwReturn["MEZUSCHLB"] = " ".PadRight(0 ); 
         dwReturn["MEMEEHB"] = " ".PadRight(3 ); 
         dwReturn["MEPREISME"] = " ".PadRight(3 ); 
         dwReturn["MEPREHGRP"] = " ".PadRight(1 ); 
         dwReturn["MEPREHFKT"] = " ".PadRight(12 ); 
         dwReturn["MEPRIO"] = " ".PadRight(2 ); 
         dwReturn["MEFILLER"] = " ".PadRight(34 ); 
         dwReturn["MEAENDZL"] = " ".PadRight(0 ); 
         dwReturn["MEAENB"] = " ".PadRight(8 ); 
         dwReturn["MEAEND"] = " ".PadRight(0 ); 
         dwReturn["MENEUB"] = " ".PadRight(8 ); 
         dwReturn["MENEUD"] = " ".PadRight(0 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapMSEINK(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveMSEINK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryMSEINK(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapMSEINK(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertMSEINK(dwLocal, ITXDBVERSION);
            }
            UpdateMSEINK(dwLocal);
        }
        public void InsertMSEINK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO MSEINK(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryMSEINK(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM MSEINK WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM MSEINK  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "MSEINK";
            Return = Result;
            return Return;
        }
        public void DeleteMSEINK(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM MSEINK   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateMSEINK(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE MSEINK SET "
                    +"MEMANDANT= :MEMANDANT,"
                    +"MEMAT= :MEMAT,"
                    +"MEVAR= :MEVAR,"
                    +"MELIEFNR= :MELIEFNR,"
                    +"MEADRSL= :MEADRSL,"
                    +"MEHANBEZ= :MEHANBEZ,"
                    +"MEEANL= :MEEANL,"
                    +"MEEANF= :MEEANF,"
                    +"MEEANA= :MEEANA,"
                    +"MEEANP= :MEEANP,"
                    +"MEZOLLTW1= :MEZOLLTW1,"
                    +"MEZOLLTW2= :MEZOLLTW2,"
                    +"MEZOLLTFR= :MEZOLLTFR,"
                    +"MEZEICHNR= :MEZEICHNR,"
                    +"MEMWST= :MEMWST,"
                    +"MEUEBERL= :MEUEBERL,"
                    +"MEUNTERL= :MEUNTERL,"
                    +"MEMINBSLM= :MEMINBSLM,"
                    +"MELIEFZT= :MELIEFZT,"
                    +"MEVPEINH1= :MEVPEINH1,"
                    +"MELOSGR1= :MELOSGR1,"
                    +"MEPREIS1= :MEPREIS1,"
                    +"MEPRDAT1= :MEPRDAT1,"
                    +"MEPREISAKT1= :MEPREISAKT1,"
                    +"MEDATVON1= :MEDATVON1,"
                    +"MEZUART1= :MEZUART1,"
                    +"MEZUSCHL1= :MEZUSCHL1,"
                    +"MEMEEH1= :MEMEEH1,"
                    +"MEVPEINH2= :MEVPEINH2,"
                    +"MELOSGR2= :MELOSGR2,"
                    +"MEPREIS2= :MEPREIS2,"
                    +"MEPRDAT2= :MEPRDAT2,"
                    +"MEPREISAKT2= :MEPREISAKT2,"
                    +"MEDATVON2= :MEDATVON2,"
                    +"MEZUART2= :MEZUART2,"
                    +"MEZUSCHL2= :MEZUSCHL2,"
                    +"MEMEEH2= :MEMEEH2,"
                    +"MEVPEINH3= :MEVPEINH3,"
                    +"MELOSGR3= :MELOSGR3,"
                    +"MEPREIS3= :MEPREIS3,"
                    +"MEPRDAT3= :MEPRDAT3,"
                    +"MEPREISAKT3= :MEPREISAKT3,"
                    +"MEDATVON3= :MEDATVON3,"
                    +"MEZUART3= :MEZUART3,"
                    +"MEZUSCHL3= :MEZUSCHL3,"
                    +"MEMEEH3= :MEMEEH3,"
                    +"MEVPEINH4= :MEVPEINH4,"
                    +"MELOSGR4= :MELOSGR4,"
                    +"MEPREIS4= :MEPREIS4,"
                    +"MEPRDAT4= :MEPRDAT4,"
                    +"MEPREISAKT4= :MEPREISAKT4,"
                    +"MEDATVON4= :MEDATVON4,"
                    +"MEZUART4= :MEZUART4,"
                    +"MEZUSCHL4= :MEZUSCHL4,"
                    +"MEMEEH4= :MEMEEH4,"
                    +"MEVPEINH5= :MEVPEINH5,"
                    +"MELOSGR5= :MELOSGR5,"
                    +"MEPREIS5= :MEPREIS5,"
                    +"MEPRDAT5= :MEPRDAT5,"
                    +"MEPREISAKT5= :MEPREISAKT5,"
                    +"MEDATVON5= :MEDATVON5,"
                    +"MEZUART5= :MEZUART5,"
                    +"MEZUSCHL5= :MEZUSCHL5,"
                    +"MEMEEH5= :MEMEEH5,"
                    +"MEKONSI= :MEKONSI,"
                    +"MEBONUS= :MEBONUS,"
                    +"MEZUARTA= :MEZUARTA,"
                    +"MEZUSCHLA= :MEZUSCHLA,"
                    +"MEMEEHA= :MEMEEHA,"
                    +"MEZUARTB= :MEZUARTB,"
                    +"MEZUSCHLB= :MEZUSCHLB,"
                    +"MEMEEHB= :MEMEEHB,"
                    +"MEPREISME= :MEPREISME,"
                    +"MEPREHGRP= :MEPREHGRP,"
                    +"MEPREHFKT= :MEPREHFKT,"
                    +"MEPRIO= :MEPRIO,"
                    +"MEFILLER= :MEFILLER,"
                    +"MEAENDZL= :MEAENDZL,"
                    +"MEAENB= :MEAENB,"
                    +"MEAEND= :MEAEND,"
                    +"MENEUB= :MENEUB,"
                    +"MENEUD= :MENEUD,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("MEMANDANT", OracleType.NVarChar).Value = dwData["MEMANDANT"].ToString(); 
          or1.Parameters.Add("MEMAT", OracleType.NVarChar).Value = dwData["MEMAT"].ToString(); 
          or1.Parameters.Add("MEVAR", OracleType.NVarChar).Value = dwData["MEVAR"].ToString(); 
          or1.Parameters.Add("MELIEFNR", OracleType.NVarChar).Value = dwData["MELIEFNR"].ToString(); 
          or1.Parameters.Add("MEADRSL", OracleType.NVarChar).Value = dwData["MEADRSL"].ToString(); 
          or1.Parameters.Add("MEHANBEZ", OracleType.NVarChar).Value = dwData["MEHANBEZ"].ToString(); 
          or1.Parameters.Add("MEEANL", OracleType.NVarChar).Value = dwData["MEEANL"].ToString(); 
          or1.Parameters.Add("MEEANF", OracleType.NVarChar).Value = dwData["MEEANF"].ToString(); 
          or1.Parameters.Add("MEEANA", OracleType.NVarChar).Value = dwData["MEEANA"].ToString(); 
          or1.Parameters.Add("MEEANP", OracleType.NVarChar).Value = dwData["MEEANP"].ToString(); 
          or1.Parameters.Add("MEZOLLTW1", OracleType.NVarChar).Value = dwData["MEZOLLTW1"].ToString(); 
          or1.Parameters.Add("MEZOLLTW2", OracleType.NVarChar).Value = dwData["MEZOLLTW2"].ToString(); 
          or1.Parameters.Add("MEZOLLTFR", OracleType.NVarChar).Value = dwData["MEZOLLTFR"].ToString(); 
          or1.Parameters.Add("MEZEICHNR", OracleType.NVarChar).Value = dwData["MEZEICHNR"].ToString(); 
          or1.Parameters.Add("MEMWST", OracleType.NVarChar).Value = dwData["MEMWST"].ToString(); 
          or1.Parameters.Add("MEUEBERL", OracleType.NVarChar).Value = dwData["MEUEBERL"].ToString(); 
          or1.Parameters.Add("MEUNTERL", OracleType.NVarChar).Value = dwData["MEUNTERL"].ToString(); 
          or1.Parameters.Add("MEMINBSLM", OracleType.NVarChar).Value = dwData["MEMINBSLM"].ToString(); 
          or1.Parameters.Add("MELIEFZT", OracleType.NVarChar).Value = dwData["MELIEFZT"].ToString(); 
          or1.Parameters.Add("MEVPEINH1", OracleType.NVarChar).Value = dwData["MEVPEINH1"].ToString(); 
          or1.Parameters.Add("MELOSGR1", OracleType.NVarChar).Value = dwData["MELOSGR1"].ToString(); 
          or1.Parameters.Add("MEPREIS1", OracleType.NVarChar).Value = dwData["MEPREIS1"].ToString(); 
          or1.Parameters.Add("MEPRDAT1", OracleType.NVarChar).Value = dwData["MEPRDAT1"].ToString(); 
          or1.Parameters.Add("MEPREISAKT1", OracleType.NVarChar).Value = dwData["MEPREISAKT1"].ToString(); 
          or1.Parameters.Add("MEDATVON1", OracleType.NVarChar).Value = dwData["MEDATVON1"].ToString(); 
          or1.Parameters.Add("MEZUART1", OracleType.NVarChar).Value = dwData["MEZUART1"].ToString(); 
          or1.Parameters.Add("MEZUSCHL1", OracleType.NVarChar).Value = dwData["MEZUSCHL1"].ToString(); 
          or1.Parameters.Add("MEMEEH1", OracleType.NVarChar).Value = dwData["MEMEEH1"].ToString(); 
          or1.Parameters.Add("MEVPEINH2", OracleType.NVarChar).Value = dwData["MEVPEINH2"].ToString(); 
          or1.Parameters.Add("MELOSGR2", OracleType.NVarChar).Value = dwData["MELOSGR2"].ToString(); 
          or1.Parameters.Add("MEPREIS2", OracleType.NVarChar).Value = dwData["MEPREIS2"].ToString(); 
          or1.Parameters.Add("MEPRDAT2", OracleType.NVarChar).Value = dwData["MEPRDAT2"].ToString(); 
          or1.Parameters.Add("MEPREISAKT2", OracleType.NVarChar).Value = dwData["MEPREISAKT2"].ToString(); 
          or1.Parameters.Add("MEDATVON2", OracleType.NVarChar).Value = dwData["MEDATVON2"].ToString(); 
          or1.Parameters.Add("MEZUART2", OracleType.NVarChar).Value = dwData["MEZUART2"].ToString(); 
          or1.Parameters.Add("MEZUSCHL2", OracleType.NVarChar).Value = dwData["MEZUSCHL2"].ToString(); 
          or1.Parameters.Add("MEMEEH2", OracleType.NVarChar).Value = dwData["MEMEEH2"].ToString(); 
          or1.Parameters.Add("MEVPEINH3", OracleType.NVarChar).Value = dwData["MEVPEINH3"].ToString(); 
          or1.Parameters.Add("MELOSGR3", OracleType.NVarChar).Value = dwData["MELOSGR3"].ToString(); 
          or1.Parameters.Add("MEPREIS3", OracleType.NVarChar).Value = dwData["MEPREIS3"].ToString(); 
          or1.Parameters.Add("MEPRDAT3", OracleType.NVarChar).Value = dwData["MEPRDAT3"].ToString(); 
          or1.Parameters.Add("MEPREISAKT3", OracleType.NVarChar).Value = dwData["MEPREISAKT3"].ToString(); 
          or1.Parameters.Add("MEDATVON3", OracleType.NVarChar).Value = dwData["MEDATVON3"].ToString(); 
          or1.Parameters.Add("MEZUART3", OracleType.NVarChar).Value = dwData["MEZUART3"].ToString(); 
          or1.Parameters.Add("MEZUSCHL3", OracleType.NVarChar).Value = dwData["MEZUSCHL3"].ToString(); 
          or1.Parameters.Add("MEMEEH3", OracleType.NVarChar).Value = dwData["MEMEEH3"].ToString(); 
          or1.Parameters.Add("MEVPEINH4", OracleType.NVarChar).Value = dwData["MEVPEINH4"].ToString(); 
          or1.Parameters.Add("MELOSGR4", OracleType.NVarChar).Value = dwData["MELOSGR4"].ToString(); 
          or1.Parameters.Add("MEPREIS4", OracleType.NVarChar).Value = dwData["MEPREIS4"].ToString(); 
          or1.Parameters.Add("MEPRDAT4", OracleType.NVarChar).Value = dwData["MEPRDAT4"].ToString(); 
          or1.Parameters.Add("MEPREISAKT4", OracleType.NVarChar).Value = dwData["MEPREISAKT4"].ToString(); 
          or1.Parameters.Add("MEDATVON4", OracleType.NVarChar).Value = dwData["MEDATVON4"].ToString(); 
          or1.Parameters.Add("MEZUART4", OracleType.NVarChar).Value = dwData["MEZUART4"].ToString(); 
          or1.Parameters.Add("MEZUSCHL4", OracleType.NVarChar).Value = dwData["MEZUSCHL4"].ToString(); 
          or1.Parameters.Add("MEMEEH4", OracleType.NVarChar).Value = dwData["MEMEEH4"].ToString(); 
          or1.Parameters.Add("MEVPEINH5", OracleType.NVarChar).Value = dwData["MEVPEINH5"].ToString(); 
          or1.Parameters.Add("MELOSGR5", OracleType.NVarChar).Value = dwData["MELOSGR5"].ToString(); 
          or1.Parameters.Add("MEPREIS5", OracleType.NVarChar).Value = dwData["MEPREIS5"].ToString(); 
          or1.Parameters.Add("MEPRDAT5", OracleType.NVarChar).Value = dwData["MEPRDAT5"].ToString(); 
          or1.Parameters.Add("MEPREISAKT5", OracleType.NVarChar).Value = dwData["MEPREISAKT5"].ToString(); 
          or1.Parameters.Add("MEDATVON5", OracleType.NVarChar).Value = dwData["MEDATVON5"].ToString(); 
          or1.Parameters.Add("MEZUART5", OracleType.NVarChar).Value = dwData["MEZUART5"].ToString(); 
          or1.Parameters.Add("MEZUSCHL5", OracleType.NVarChar).Value = dwData["MEZUSCHL5"].ToString(); 
          or1.Parameters.Add("MEMEEH5", OracleType.NVarChar).Value = dwData["MEMEEH5"].ToString(); 
          or1.Parameters.Add("MEKONSI", OracleType.NVarChar).Value = dwData["MEKONSI"].ToString(); 
          or1.Parameters.Add("MEBONUS", OracleType.NVarChar).Value = dwData["MEBONUS"].ToString(); 
          or1.Parameters.Add("MEZUARTA", OracleType.NVarChar).Value = dwData["MEZUARTA"].ToString(); 
          or1.Parameters.Add("MEZUSCHLA", OracleType.NVarChar).Value = dwData["MEZUSCHLA"].ToString(); 
          or1.Parameters.Add("MEMEEHA", OracleType.NVarChar).Value = dwData["MEMEEHA"].ToString(); 
          or1.Parameters.Add("MEZUARTB", OracleType.NVarChar).Value = dwData["MEZUARTB"].ToString(); 
          or1.Parameters.Add("MEZUSCHLB", OracleType.NVarChar).Value = dwData["MEZUSCHLB"].ToString(); 
          or1.Parameters.Add("MEMEEHB", OracleType.NVarChar).Value = dwData["MEMEEHB"].ToString(); 
          or1.Parameters.Add("MEPREISME", OracleType.NVarChar).Value = dwData["MEPREISME"].ToString(); 
          or1.Parameters.Add("MEPREHGRP", OracleType.NVarChar).Value = dwData["MEPREHGRP"].ToString(); 
          or1.Parameters.Add("MEPREHFKT", OracleType.NVarChar).Value = dwData["MEPREHFKT"].ToString(); 
          or1.Parameters.Add("MEPRIO", OracleType.NVarChar).Value = dwData["MEPRIO"].ToString(); 
          or1.Parameters.Add("MEFILLER", OracleType.NVarChar).Value = dwData["MEFILLER"].ToString(); 
          or1.Parameters.Add("MEAENDZL", OracleType.NVarChar).Value = dwData["MEAENDZL"].ToString(); 
          or1.Parameters.Add("MEAENB", OracleType.NVarChar).Value = dwData["MEAENB"].ToString(); 
          or1.Parameters.Add("MEAEND", OracleType.NVarChar).Value = dwData["MEAEND"].ToString(); 
          or1.Parameters.Add("MENEUB", OracleType.NVarChar).Value = dwData["MENEUB"].ToString(); 
          or1.Parameters.Add("MENEUD", OracleType.NVarChar).Value = dwData["MENEUD"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
